package bookSystem.operations;

import bookSystem.book.BookList;

public class ShowOperation implements IOperation{
    //显示图书
    public void work(BookList bookList){
        System.out.println("---------------------------------------------");
        try {
            for (int i = 0; i < bookList.getUsedSize(); i++) {
                System.out.println(bookList.getBook(i).toString());
            }
        }catch (NullPointerException e){
            System.out.println("图书馆里没有书籍");
        }
        System.out.println("---------------------------------------------");
    }

}
